package interaction.input.concrete;

import interaction.sampling.Sample;
import processing.core.PGraphics;
import processing.core.PImage;
import processing.core.PVector;

public class BeatImagePromptComponent extends AbstractBeatComponent<String> {
	private PImage image;
	
	public BeatImagePromptComponent(PVector position, PImage image) {
		super(position, new PVector(image.width, image.height));
		this.image = image;
	}
	
	public PImage getImage() {
		return image;
	}

	protected void drawRelative(PGraphics g) {
		g.image(getImage(), 0, 0);
	}
	
	public void mousePressed(PVector p) {
		getDataSource().set("click");
	}
	
	public void keyPressed(char c) {
		getDataSource().set("click");
	}
	
	public void slapReceived(Sample s) {
		getDataSource().set("slap");
	}
	
	public void tapReceived(Sample s) {
		getDataSource().set("tap");
	}

}
